package com.tbsoft.trail.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.digester3.annotations.rules.BeanPropertySetter;
import org.apache.commons.digester3.annotations.rules.ObjectCreate;
/**
 * @desc 订单实体对象
 * @author lizhenhua
 *
 */
@Entity
@Table(name = "PURCHASE_ORDER")
@ObjectCreate(pattern = "customer/purchaseOrder")
public class PurchaseOrder implements Serializable {

	private int id;
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@BeanPropertySetter(pattern = "customer/purchaseOrder/product")
	private String product;

	@BeanPropertySetter(pattern = "customer/purchaseOrder/amount")
	private Integer amount;

	@BeanPropertySetter(pattern = "customer/purchaseOrder/price")
	private BigDecimal price;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "PRODUCT_NAME",length=50)
	public String getProduct() {
		return product;
	}

	public void setProduct(String product) {
		this.product = product;
	}

	@Column(name = "AMOUNT")
	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	@Column(name = "PRACE", precision = 18, scale = 6)
	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Override
	public String toString() {
		return "PurchaseOrder [amount=" + amount + ", price="
				+ price + ", product=" + product + "]";
	}
	
	

}
